Skip to content

Conversation

@JanCaha
Copy link
Contributor

@JanCaha JanCaha commented Dec 18, 2025

Description

This allows storing older versions of QGIS projects in PostgreSQL. The process is mostly handled by a function and a trigger in the DB.

There are two places to handle the turning on versions of projects and loading previous versions.

Browser

On schema, user has option to enable the feature (with confirmation dialog). The action is disabled if the versioning is already active for the schema.
2025-10-27-11-44-03

On project user either has option to allow versioning on the parent schema of the project

2025-10-27-11-45-27

If the versioning is already active the user can see the versions of the project.

2025-10-27-11-45-13 versions jpg

Open From.../Save To...

In those menus the user can also enable the feature and select previous version to load.

save_project

When loading QGIS project from schema that has versions activated the user can select older version of the project to load, by selecting it in the QTableWidget. If nothing is selected there the active version of QGIS project is loaded.

load_project

Fixes #62299

Funded by: Ocean Winds

@github-actions github-actions bot added this to the 4.0.0 milestone Dec 18, 2025
@JanCaha
Copy link
Contributor Author

JanCaha commented Dec 18, 2025

This is a redo of #63663 which was kind of messed up by rebase.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 18, 2025

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit 5eff1fe)

🍎 MacOS Qt6 builds

Download MacOS Qt6 builds of this PR for testing.
This installer is not signed, control+click > open the app to avoid the warning
(Built from commit 5eff1fe)

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Jan 3, 2026
@github-actions github-actions bot removed the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Jan 4, 2026
@qgis qgis deleted a comment from github-actions bot Jan 5, 2026
Copy link
Contributor

@uclaros uclaros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last ultra minor comment!

Co-authored-by: Stefanos Natsis <uclaros@gmail.com>
@BathoryPeter
Copy link
Contributor

I think the name of the feature is misleading. This versioning only keeps the last 10 states which cannot be changed, and versions cannot be deleted or renamed, etc. I think the name auto backup would be a much better fit for this functionality.

@uclaros
Copy link
Contributor

uclaros commented Jan 9, 2026

I think the name of the feature is misleading. This versioning only keeps the last 10 states which cannot be changed, and versions cannot be deleted or renamed, etc. I think the name auto backup would be a much better fit for this functionality.

This is definitely not a backup! Deleting a project will also delete all previous versions, which is something you would not want from a backup!
Storing more than 10 states and deleting versions is kind of an advanced feature. Anyone wanting this can as well modify the trigger and the qgis_projects_versions table directly. Renaming would be a weird feature, but one could also modify the comments field instead.

Having said that, the 10 states is not a value set in stone, it's just what we thought was a sensible default value so that we do not keep huge amounts of unnecessary projects in the database.

@uclaros uclaros merged commit 12686d2 into qgis:master Jan 14, 2026
36 checks passed
@JanCaha JanCaha deleted the postgresql-qgis-project-versioning-v2 branch January 15, 2026 08:46
@DelazJ DelazJ added Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo. Changelog Items that are queued to appear in the visual changelog - remove after harvesting labels Jan 16, 2026
@qgis-bot
Copy link
Collaborator

@JanCaha

This pull request has been tagged for the changelog.

  • The description will be harvested so please provide a "nearly-ready" text for the final changelog
  • If possible, add a nice illustration of the feature. Only the first one in the description will be harvested (GIF accepted as well)
  • If you can, it's better to give credits to your sponsor, see below for different formats.

You can edit the description.

Format available for credits
  • Funded by NAME
  • Funded by URL
  • Funded by NAME URL
  • Sponsored by NAME
  • Sponsored by URL
  • Sponsored by NAME URL

Thank you!

nyalldawson pushed a commit to nyalldawson/QGIS that referenced this pull request Jan 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changelog Items that are queued to appear in the visual changelog - remove after harvesting Feature Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo. PostGIS data provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable versioning for QGIS Projects stored in Postgres, managed in the Browser

6 participants